package org.lovebugs.common;

import org.lovebugs.dkm.MainActivity;
import org.lovebugs.dkm.R;

import android.media.MediaPlayer;
import android.support.v4.app.Fragment;
import android.view.TextureView;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

public class PageHeader implements OnClickListener{

	private Fragment mContext;
	
	private ImageView allSubjects;
	
	private TextView title;
	
	private ImageView bookmark ;
	
	private MainActivity mActivity;
	
	public PageHeader(Fragment activity) {
		mContext = activity;
		init();
	}

	private void init() {
		// TODO Auto-generated method stub
		allSubjects = (ImageView)mContext.getActivity().findViewById(R.id.allSubjects);
//		allSubjects.setOnClickListener(this);
//		allSubjects.setVisibility(View.GONE);
		title = (TextView)mContext.getActivity().findViewById(R.id.title);
		bookmark = (ImageView)mContext.getActivity().findViewById(R.id.bookmark);
		bookmark.setOnClickListener(this);
		bookmark.setVisibility(View.GONE);
		mActivity = (MainActivity)mContext.getActivity();
	}
	
	public void setTitle(String title){
		this.title.setText(title);
	}
	
	public void setLeftBtnVisible(boolean show){
		/*if(show) {
			allSubjects.setVisibility(View.VISIBLE);
		}else{
			allSubjects.setVisibility(View.GONE);
		}*/
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch(v.getId()) {
		case R.id.allSubjects:
//			mActivity.showSlipMenu();
			break;
		case R.id.bookmark:
			break;
		}
		
	}
}
